<?php namespace Framework\Kernel;

require 'Framework/Org/Smarty/Smarty.class.php';

//基础控制器
class Controller extends \Smarty
{
	public $template_dir='abc';
	public $compile_dir='ccc';
	public $left_delimiter='{{';
	public $right_delimiter='}}';
	public function __construct()
	{
		$this->template_dir = 'app/'.MODULE.'/View/'.CONTROLLER;
		$this->compile_dir = 'storage/view/'.MODULE;
		if(!is_dir($this->compile_dir))
		{
			mkdir($this->compile_dir,0755,true);
		}
	}

	//成功的方法
	public function success($message,$url='')
	{
		$url = $url?$url:$_SERVER['HTTP_REFERER'];
		$this->assign('url',$url);
		$this->assign('message',$message);
		$this->template_dir='public';
		$this->display('success.php');
	}

	//成功的方法
	public function error($message,$url='')
	{
		$url = $url?$url:$_SERVER['HTTP_REFERER'];
		$this->assign('url',$url);
		$this->assign('message',$message);
		$this->template_dir='public';
		$this->display('error.php');
	}
}












